package developer.zyk.ability.chat.dao.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import developer.zyk.ability.chat.dao.entity.ChatHistoryDetailDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author zhangyongkang
 * @time 2025/4/30 16:06
 * @description
 */
@Mapper
public interface ChatHistoryDetailMapper extends BaseMapper<ChatHistoryDetailDO> {

    @Select("select max(chat_order) from ai_chat_history_detail where chat_id =#{chatId}")
    Integer getMaxOrder(@Param("chatId") Long chatId);
}
